package com.cenwangkeji.resident.ui.activity.special;

import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.text.TextUtils;

import com.cenwangkeji.resident.R;
import com.cenwangkeji.resident.model.Constant;
import com.cenwangkeji.resident.model.OkHttpUtils;
import com.cenwangkeji.resident.model.bean.HealthBean;
import com.cenwangkeji.resident.model.bean.User;
import com.cenwangkeji.resident.ui.adapter.SpecialDiseaseDetailAdapter;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

import com.lws.basic.base.BaseActivity;
import com.lws.basic.persenter.ObserverOnNext;
import com.lws.basic.utils.common.MyLogger;
import com.lws.basic.utils.common.MyToast;
import com.lws.basic.utils.common.RxUtils;
import com.lws.basic.view.adapter.AdapterIntegerDefault0;
import com.lws.basic.view.adapter.DoubleDefault0Adapter;
import com.tencent.bugly.crashreport.CrashReport;

import org.json.JSONObject;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import butterknife.BindView;
import butterknife.ButterKnife;
import io.reactivex.Observable;
import io.reactivex.ObservableEmitter;
import io.reactivex.ObservableOnSubscribe;
//健康详情
public class HealthCheckDetailActivity extends BaseActivity {



    @Override
    public int setLayoutId() {
        return R.layout.activity_xer_detail;
    }

    @BindView(R.id.rv)
    RecyclerView mRv;
    private SpecialDiseaseDetailAdapter mAdapter;

    @Override
    public void initData() {
        super.initData();
        ButterKnife.bind(this);
        initRecycelrView();
        getData();
    }

    private void initRecycelrView() {
        mRv.setLayoutManager(new LinearLayoutManager(this));
        mAdapter = new SpecialDiseaseDetailAdapter(null);
        mRv.setAdapter(mAdapter);
    }


    private void getData() {
        showLoading();
        Observable.create(new ObservableOnSubscribe<HealthBean>() {
            @Override
            public void subscribe(ObservableEmitter<HealthBean> emitter) throws Exception {
                int id = getIntent().getIntExtra("id", 0);
                Map<Object, Object> map = new HashMap<>();
                map.put("token", User.getToken());
                map.put("mark", 3);
                map.put("zxbId", id);
                JSONObject jsonObject = new JSONObject(map);
                MyLogger.i(jsonObject.toString());
                Gson gson = new GsonBuilder()
                        .registerTypeAdapter(Integer.class, new AdapterIntegerDefault0())
                        .registerTypeAdapter(int.class, new AdapterIntegerDefault0())
                        .registerTypeAdapter(Double.class, new DoubleDefault0Adapter())
                        .registerTypeAdapter(double.class, new DoubleDefault0Adapter())
                        .create();
                String json = OkHttpUtils.post(jsonObject.toString(),Constant.health_check_detail);
                MyLogger.i(json);
                emitter.onNext(gson.fromJson(json,HealthBean.class));
            }
        }).compose(RxUtils.<HealthBean>io_main()).subscribe(new ObserverOnNext<HealthBean>() {
            @Override
            public void onNext(HealthBean bean) {
                try {
                    dismissLoading();
                    if (bean.getData() != null) {
                        List<String> list = new ArrayList<>();
                        list.add("症状:  " + zz(bean.getData().getZzList(), bean.getData().getZzQt()));
                        list.add("体温（℃）: " + bean.getData().getTw());
                        list.add("呼吸频率(次/分钟):  " + bean.getData().getHxpl());
                        list.add("血压(mmHg)左侧:  " + bean.getData().getZcxy() + "    右侧:  " + bean.getData().getYcxy());
                        list.add("身高(cm):  " + bean.getData().getSg());
                        list.add("体重(kg):  " + bean.getData().getTz());
                        list.add("腰围(cm):  " + bean.getData().getYw());
                        list.add("体质指数(kg/m2):  " + bean.getData().getTzzs());
                        list.add("老年人健康状态自我评估:  " + lnrjkzt(bean.getData().getJkztzwpg()));
                        list.add("老年人生活自理能力自我评估:  " + lnrzhzl(bean.getData().getZlnlzwpg()));
                        list.add("老年人认知功能:  " + lnrrzgn(bean.getData().getRzgn()));
                        list.add("简易智力状态评分:  " + bean.getData().getRzgnPf());
                        list.add("老年人情感状态:  " + lnrrzgn(bean.getData().getQgzk()));
                        list.add("老年人抑郁评分:  " + bean.getData().getQgzkPf());
                        list.add("锻炼频率:  " + dlpl(bean.getData().getDlpl()));
                        list.add("每次锻炼多少分钟:  " + bean.getData().getMcdlsj());
                        list.add("坚持锻炼多少年:  " + bean.getData().getJcdlsj());
                        list.add("锻炼方式:  " + bean.getData().getDlfs());
                        if (!TextUtils.isEmpty(bean.getData().getYsxg())) {
                            list.add("饮食习惯:  " + ysxg(Integer.valueOf(bean.getData().getYsxg())));
                        }
                        list.add("吸烟状况:  " + xyqk(bean.getData().getXyzk()));
                        list.add("日吸烟量（支）:  " + bean.getData().getRxyl());
                        list.add("开始吸烟年龄:  " + bean.getData().getKsxynl());
                        list.add("戒烟年龄:  " + bean.getData().getJynl());
                        list.add("饮酒频率:  " + yjpl(bean.getData().getYjpl()));
                        list.add("日吸饮酒量（两）:  " + bean.getData().getRyjl());
                        list.add("是否戒酒:  " + sf(bean.getData().getSfjj()));
                        list.add("戒酒年龄(岁):  " + bean.getData().getJjnl());
                        list.add("开始饮酒年龄(岁):  " + bean.getData().getKsyjnl());
                        list.add("近一年内是否曾醉酒:  " + fs(bean.getData().getJynsfyj()));
                        list.add("饮酒种类:  " + yjzl(bean.getData().getYjzlList(), bean.getData().getYjzlQt()));
                        list.add("职业病危害因素:  " + wy(bean.getData().getZybwh()));
                        list.add("工种:  " + bean.getData().getZybwhGz());
                        list.add("从业时间(年):  " + bean.getData().getZybwhN());
                        list.add("粉尘:  " + bean.getData().getDwzlFc());
                        list.add("防护措施:  " + sf(bean.getData().getFcFhcs()));
                        list.add("放射物质:  " + bean.getData().getDwzlFswz());
                        if (!TextUtils.isEmpty(bean.getData().getFswzFhcsms())) {
                            list.add("防护措施:  " + sf(Integer.valueOf(bean.getData().getFswzFhcsms())));
                        }
                        list.add("物理因素:  " + bean.getData().getDwzlWlys());
                        list.add("防护措施:  " + sf(bean.getData().getWlysFhcs()));
                        list.add("化学物质:  " + bean.getData().getHxwzFhcsms());
                        list.add("防护措施:  " + sf(bean.getData().getHxwzFhcs()));
                        list.add("其他:  " + bean.getData().getDwzlQt());
                        list.add("防护措施:  " + sf(bean.getData().getQtFhcs()));
                        list.add("口唇:  " + kc(bean.getData().getKc()));
                        list.add("齿列:  " + cl(bean.getData().getClList()));
                        list.add("咽部:  " + yb(bean.getData().getYb()));
                        list.add("视力左眼:  " + bean.getData().getSlZy() + "     右眼: " + bean.getData().getSlYy());
                        list.add("矫正视力左眼:  " + bean.getData().getJzslZy() + "     右眼: " + bean.getData().getJzslYy());
                        list.add("听力:  " + tl(bean.getData().getTl()));
                        list.add("运动功能:  " + ydgn(bean.getData().getYdgn()));
                        list.add("眼底:  " + yd(bean.getData().getYd(), bean.getData().getYdyc()));
                        list.add("皮肤:  " + pf(bean.getData().getPf(), bean.getData().getPfqt()));
                        list.add("巩膜:  " + gm(bean.getData().getGm(), bean.getData().getGmqt()));
                        list.add("淋巴结:  " + lbj(bean.getData().getLbj(), bean.getData().getLbjqt()));
                        list.add("桶装胸:  " + fs(bean.getData().getTzx()));
                        list.add("呼吸音:  " + zcyc(bean.getData().getHxy()));
                        list.add("罗音:  " + ly(bean.getData().getLy(), bean.getData().getLyqt()));
                        list.add("心率(次/分钟):  " + bean.getData().getXlpc());
                        list.add("心律:  " + xl(bean.getData().getXl()));
                        list.add("杂音:  " + wy(bean.getData().getZy()));
                        list.add("压痛:  " + wy(bean.getData().getFbyt()));
                        list.add("肝大:  " + wy(bean.getData().getFbgd()));
                        list.add("脾大:  " + wy(bean.getData().getFbpd()));
                        list.add("移动性浊音:  " + wy(bean.getData().getFbydxzy()));
                        list.add("下肢水肿:  " + xzsz(bean.getData().getXzsz()));
                        list.add("足背动脉搏动:  " + zbdmbd(bean.getData().getZbdmbd()));
                        list.add("肛门指针:  " + gmzz(bean.getData().getGmzz(), bean.getData().getGmqt()));
                        list.add("乳腺:  " + rx(bean.getData().getRxList(), bean.getData().getRxQt()));
                        list.add("外阴:  " + yc(bean.getData().getFkWy()));
                        list.add("阴道:  " + yc(bean.getData().getFkYd()));
                        list.add("宫颈:  " + yc(bean.getData().getFkGj()));
                        if (!TextUtils.isEmpty(bean.getData().getFkGtms())) {
                            list.add("宫体:  " + yc(Integer.valueOf(bean.getData().getFkGtms())));

                        }
                        list.add("附件:  " + yc(bean.getData().getFkFj()));
                        list.add("妇科其他:  " + bean.getData().getFkQt());
                        list.add("血红蛋白(g/L):  " + bean.getData().getXcgXhdb());
                        list.add("白细胞(×10^9/L):  " + bean.getData().getXcgBxb());
                        list.add("血小板(×10^9/L):  " + bean.getData().getXcgXxb());
                        list.add("血常规其他:  " + bean.getData().getXcgQt());
                        list.add("尿蛋白:  " + bean.getData().getNcgNdb());
                        list.add("尿糖:  " + bean.getData().getNcgNt());
                        list.add("尿酮体:  " + bean.getData().getNcgNtt());
                        list.add("尿潜血:  " + bean.getData().getNcgNqx());
                        list.add("尿常规其他:  " + bean.getData().getNcgQt());
                        list.add("空腹血糖(mol/L):  " + bean.getData().getKfxt1());
                        list.add("空腹血糖(mg/dL):  " + bean.getData().getKfxt2());
                        list.add("心电图:  " + xdt(bean.getData().getXdt())+"  "+bean.getData().getXdtYc());
                        list.add("尿微量白蛋白(mg/dL):  " + bean.getData().getNwlbdb());
                        list.add("大便潜血:  " + yxyx(bean.getData().getDbqx()));
                        list.add("糖化血红蛋白(%):  " + bean.getData().getThxhdb());
                        list.add("乙型肝炎表面抗原:  " + yxyx(bean.getData().getYxgy()));
                        list.add("血清谷丙转氨酶(U/L):  " + bean.getData().getGgXqgbzam());
                        list.add("血清谷草转氨酶(U/L):  " + bean.getData().getGgXqgczam());
                        list.add("白蛋白(g/L):  " + bean.getData().getGgBdb());
                        list.add("总胆红素(μmol/L):  " + bean.getData().getGgZdhs());
                        list.add("结合胆红素(μmol/L):  " + bean.getData().getGgJhdhs());
                        list.add("血清肌酐(μmol/L):  " + bean.getData().getSgXqjg());
                        list.add("血尿素(mmol/L):  " + bean.getData().getSgXns());
                        list.add("血钾浓度(mmol/L):  " + bean.getData().getSgXjnd());
                        list.add("血钠浓度(mmol/L):  " + bean.getData().getSgXnnd());
                        list.add("总胆固醇(mmol/L):  " + bean.getData().getXzZdgc());
                        list.add("甘油三酯(mmol/L):  " + bean.getData().getXzGysz());
                        list.add("血清低密度脂蛋白胆固醇(mmol/L):  " + bean.getData().getXzXqdmdzdbdgc());
                        list.add("血清低密度脂蛋白胆固醇(mmol/L):  " + bean.getData().getXzXqgmdzdbdgc());
                        list.add("胸部X线片:  " + zcyc(bean.getData().getXbxxp()));
                        list.add("腹部B超:  " + zcyc(bean.getData().getBcFbbc())+"  "+bean.getData().getBcYc());
                        list.add("B超其他:  " + zcyc(bean.getData().getBcQt()));
                        list.add("宫颈涂片:  " + zcyc(bean.getData().getGjtp()));
                        list.add("辅助检查其他:  " + bean.getData().getFzjcQt());
                        list.add("脑血管疾病:   " + nxg(bean.getData().getNxgjbList(), bean.getData().getNxgjbQt()));
                        list.add("肾脏疾病:    " + szjb(bean.getData().getSzjbList(), bean.getData().getSzjbQt()));
                        list.add("心脏疾病:  " + xzjb(bean.getData().getXzjbList(), bean.getData().getXzjbQt()));
                        list.add("血管疾病:  " + xgjb(bean.getData().getXgjbList(), bean.getData().getXgjbQt()));
                        list.add("眼部疾病:  " + ybjb(bean.getData().getYbjbList(), bean.getData().getYbjbQt()));
                        list.add("神经系统的疾病:  " + fxy(bean.getData().getSjxtjb()));
                        list.add("其他系统疾病:  " + fxy(bean.getData().getQtxtjb()));
                        list.add("入院日期:  " + bean.getData().getZys1Ryrq());
                        list.add("出院日期:  " + bean.getData().getZys1Cyrq());
                        list.add("原因:  " + bean.getData().getZys1Yy());
                        list.add("医疗结构名称:  " + bean.getData().getZys1Yljgmc());
                        list.add("病案号:  " + bean.getData().getZys1Bah());
                        list.add("建床日期:  " + bean.getData().getJtbcs1Jcrq());
                        list.add("撤床日期:  " + bean.getData().getJtbcs1Ccrq());
                        list.add("原因:  " + bean.getData().getJtbcs1Yy());
                        list.add("医疗机构名称:  " + bean.getData().getJtbcs1Yljgmc());
                        list.add("病案号:  " + bean.getData().getJtbcs1Bah());
                        if (!TextUtils.isEmpty(bean.getData().getYyqk1Yymc())) {
                            list.add("药物名称:  " + bean.getData().getYyqk1Yymc());
                            list.add("用法:  " + bean.getData().getYyqk1Yf());
                            list.add("用量:  " + bean.getData().getYyqk1Yl());
                            list.add("用药时间:  " + bean.getData().getYyqk1Yysj());

                        }
                        if (!TextUtils.isEmpty(bean.getData().getYyqk2Yymc())) {
                            list.add("药物名称:  " + bean.getData().getYyqk2Yymc());
                            list.add("用法:  " + bean.getData().getYyqk2Yf());
                            list.add("用量:  " + bean.getData().getYyqk2Yl());
                            list.add("用药时间:  " + bean.getData().getYyqk2Yysj());
                        }
                        if (!TextUtils.isEmpty(bean.getData().getYyqk3Yymc())) {
                            list.add("药物名称:  " + bean.getData().getYyqk3Yymc());
                            list.add("用法:  " + bean.getData().getYyqk3Yf());
                            list.add("用量:  " + bean.getData().getYyqk3Yl());
                            list.add("用药时间:  " + bean.getData().getYyqk3Yysj());
                        }
                        if (!TextUtils.isEmpty(bean.getData().getYyqk4Yymc())) {
                            list.add("药物名称:  " + bean.getData().getYyqk4Yymc());
                            list.add("用法:  " + bean.getData().getYyqk4Yf());
                            list.add("用量:  " + bean.getData().getYyqk4Yl());
                            list.add("用药时间:  " + bean.getData().getYyqk4Yysj());
                        }
                        if (!TextUtils.isEmpty(bean.getData().getYyqk5Yymc())) {
                            list.add("药物名称:  " + bean.getData().getYyqk5Yymc());
                            list.add("用法:  " + bean.getData().getYyqk5Yf());
                            list.add("用量:  " + bean.getData().getYyqk5Yl());
                            list.add("用药时间:  " + bean.getData().getYyqk5Yysj());
                        }
                        if (!TextUtils.isEmpty(bean.getData().getYyqk6Yymc())) {
                            list.add("药物名称:  " + bean.getData().getYyqk6Yymc());
                            list.add("用法:  " + bean.getData().getYyqk6Yf());
                            list.add("用量:  " + bean.getData().getYyqk6Yl());
                            list.add("用药时间:  " + bean.getData().getYyqk6Yysj());
                        }
                        if (!TextUtils.isEmpty(bean.getData().getFmyghyfjzs1Mc())) {
                            list.add("非免疫规划预防接种史:\n");
                            list.add("名称:  " + bean.getData().getFmyghyfjzs1Mc());
                            list.add("接种日期:  " + bean.getData().getFmyghyfjzs1Jzrq());
                            list.add("接种机构:  " + bean.getData().getFmyghyfjzs1Jzjg());
                        }
                        if (!TextUtils.isEmpty(bean.getData().getFmyghyfjzs2Mc())) {
                            list.add("非免疫规划预防接种史:\n");
                            list.add("名称:  " + bean.getData().getFmyghyfjzs2Mc());
                            list.add("接种日期:  " + bean.getData().getFmyghyfjzs2Jzrq());
                            list.add("接种机构:  " + bean.getData().getFmyghyfjzs2Jzjg());
                        }
                        if (!TextUtils.isEmpty(bean.getData().getFmyghyfjzs3Mc())) {
                            list.add("非免疫规划预防接种史:\n");
                            list.add("名称:  " + bean.getData().getFmyghyfjzs3Mc());
                            list.add("接种日期:  " + bean.getData().getFmyghyfjzs3Jzrq());
                            list.add("接种机构:  " + bean.getData().getFmyghyfjzs3Jzjg());
                        }
                        list.add("健康评价:  " + jkpj(bean.getData().getJkpj()));
                        if (bean.getData().getJkpj() == 2) {
                            list.add("异常1:  " + bean.getData().getJkpjYc1());
                            list.add("异常2:  " + bean.getData().getJkpjYc2());
                            list.add("异常3:  " + bean.getData().getJkpjYc3());
                            list.add("异常4:  " + bean.getData().getJkpjYc4());
                        }
                        list.add("健康指导:  " + jkzd(bean.getData().getJkzdList()));
                        list.add("危险控制:  " + wxyskz(bean.getData().getWxyskzList(), bean.getData().getWxyskzJtz() + "", bean.getData().getWxyskzQt()));
                        list.add("时间:  " + bean.getData().getCreateDate());
                        mAdapter.setNewData(list);
                    } else {
                        MyToast.show(bean.getMsg());
                    }
                }catch (Exception e){
                    MyToast.show(e.getMessage());
                    CrashReport.postCatchedException(e);
                }
            }
        });

    }
  //危险因素控制
    private String wxyskz(List<String> list,String tz,String qt){
        String s ="";
        for (int i =0; i<list.size() ;i++) {
            switch (list.get(i)) {
                case "1":
                    s += "戒烟  ";
                    break;
                case "2":
                    s += "健康饮酒  ";
                    break;
                case "3":
                    s += "饮食  ";
                    break;
                case "4":
                    s += "锻炼  ";
                    break;
                case "5":
                    s += "减体重  目标(kg)"+tz+"   ";
                    break;
                case "6":
                    s += "建议接种疫苗  ";
                    break;
                case "7":
                    s += qt;
                    break;
            }
        }
        return s;
    }

    //健康指导
    private String jkzd(List<String> list){
        String s ="";
        for (int i =0; i<list.size() ;i++) {
            switch (list.get(i)) {
                case "1":
                    s += "纳入慢性病患者健康管理  ";
                    break;
                case "2":
                    s += "健康复查  ";
                    break;
                case "3":
                    s += "建议转诊  ";
                    break;
            }
        }
        return s;
    }


    //健康评价
    private String jkpj(int index){
        String s= "";
        switch (index){
            case 1:
                s = "体检无异常";
                break;
            case 2:
                s = "有异常";
                break;

        }
        return s;
    }


    //未返现 有
    private String fxy(int index){
        String s= "";
        switch (index){
            case 1:
                s = "未发现";
                break;
            case 2:
                s = "有";
                break;

        }
        return s;
    }



    //眼部疾病
    private String ybjb(List<String> list,String qt){
        String s ="";
        for (int i =0; i<list.size() ;i++) {
            switch (list.get(i)) {
                case "1":
                    s += "未发现  ";
                    break;
                case "2":
                    s += "视网膜出血或渗血  ";
                    break;
                case "3":
                    s += "视乳头水肿  ";
                    break;
                case "4":
                    s += "白内障  ";
                    break;
                case "5":
                    s += qt;
                    break;

            }
        }
        return s;
    }


    //血管疾病
    private String xgjb(List<String> list,String qt){
        String s ="";
        for (int i =0; i<list.size() ;i++) {
            switch (list.get(i)) {
                case "1":
                    s += "未发现  ";
                    break;
                case "2":
                    s += "夹层动脉  ";
                    break;
                case "3":
                    s += "动脉闭塞性疾病  ";
                    break;
                case "4":
                    s += qt;
                    break;

            }
        }
        return s;
    }

    //心脏疾病
    private String xzjb(List<String> list,String qt){
        String s ="";
        for (int i =0; i<list.size() ;i++) {
            switch (list.get(i)) {
                case "1":
                    s += "未发现  ";
                    break;
                case "2":
                    s += "心肌梗死  ";
                    break;
                case "3":
                    s += "心绞痛  ";
                    break;
                case "4":
                    s += "冠状动脉血运重建  ";
                    break;
                case "5":
                    s += "充血性心力衰竭  ";
                    break;
                case "6":
                    s += "心前区疼痛  ";
                    break;
                case "7":
                    s += qt;
                    break;
            }
        }
        return s;
    }



    //肾脏疾病
    private String szjb(List<String> list,String qt){
        String s ="";
        for (int i =0; i<list.size() ;i++) {
            switch (list.get(i)) {
                case "1":
                    s += "未发现  ";
                    break;
                case "2":
                    s += "糖尿病肾脏  ";
                    break;
                case "3":
                    s += "肾功能衰竭  ";
                    break;
                case "4":
                    s += "急性肾炎  ";
                    break;
                case "5":
                    s += "慢性肾炎  ";
                    break;
                case "6":
                    s += qt;
                    break;
            }
        }
        return s;
    }

    //脑血管疾病
    private String nxg(List<String> list,String qt){
        String s ="";
        for (int i =0; i<list.size() ;i++) {
            switch (list.get(i)) {
                case "1":
                    s += "未发现  ";
                    break;
                case "2":
                    s += "缺血性卒中  ";
                    break;
                case "3":
                    s += "脑出血  ";
                    break;
                case "4":
                    s += "蛛网膜下腔出血  ";
                    break;
                case "5":
                    s += "短暂性脑缺血发作  ";
                    break;
                case "6":
                    s += qt;
                    break;
            }
        }
        return s;
    }


    //阴性阳性
    private String yxyx(int index){
        String s= "";
        switch (index){
            case 1:
                s = "阴性";
                break;
            case 2:
                s = "阳性";
                break;

        }
        return s;
    }



    //正常异常
    private String xdt(int index){
        String s= "";
        switch (index){
            case 1:
                s ="正常";
                break;
            case 2:
                s = "异常";
                break;

        }
        return s;
    }
    //乳腺
    private String rx(List<String> list,String qt){
        String s ="";
        for (int i =0; i<list.size() ;i++) {
            switch (list.get(i)) {
                case "1":
                    s += "未及异常  ";
                    break;
                case "2":
                    s += "乳房切除  ";
                    break;
                case "3":
                    s += "异常分乳  ";
                    break;
                case "4":
                    s += "乳腺包块  ";
                    break;
                case "5":
                    s += qt;
                    break;

            }
        }
        return s;
    }

    //异常
    private String yc(int index){
        String s = "";
        switch (index){
            case 1:
                s = "未及异常";
                break;
            case 2:
                s = "异常";
                break;


        }
        return s;

    }


    //肛门指诊
    private String gmzz(int index,String qt){
        String s = "";
        switch (index){
            case 1:
                s = "未及异常";
                break;
            case 2:
                s = "触痛";
                break;
            case 3:
                s = "包块";
                break;
            case 4:
                s = "前列腺异常";
                break;
            case 5:
                s = qt;
                break;

        }
        return s;

    }

    //足背动脉搏动
    private String zbdmbd(int index){
        String s = "";
        switch (index){
            case 1:
                s = "未触及";
                break;
            case 2:
                s = "触及双侧对称";
                break;
            case 3:
                s = "触及左侧弱或消失";
                break;
            case 4:
                s = "触及右侧弱或消失";
                break;

        }
        return s;

    }

    //下肢水肿
    private String xzsz(int index){
        String s = "";
        switch (index){
            case 1:
                s = "无";
                break;
            case 2:
                s = "单侧";
                break;
            case 3:
                s = "双侧不对称";
                break;
        }
        return s;
    }

    //心律
    private String xl(int index){
        String s = "";
        switch (index){
            case 1:
                s = "齐";
                break;
            case 2:
                s = "不齐";
                break;
            case 3:
                s = "绝对不齐";
                break;

        }
        return s;

    }

    //罗音
    private String ly(int index,String qt){
        String s = "";
        switch (index){
            case 1:
                s = "无";
                break;
            case 2:
                s = "千罗音";
                break;
            case 3:
                s = "湿罗音";
                break;
            case 4:
                s = qt;
                break;

        }
        return s;
    }

    //正常 异常
    private String zcyc(int index){
        String s = "";
        switch (index){
            case 1:
                s = "正常";
                break;
            case 2:
                s = "异常";
                break;

        }
        return s;
    }



    //淋巴结
    private String lbj(int index,String qt){
        String s = "";
        switch (index){
            case 1:
                s = "未触及";
                break;
            case 2:
                s = "锁骨上";
                break;
            case 3:
                s = "腋窝";
                break;
            case 4:
                s = qt;
                break;


        }
        return s;
    }

    //巩膜
    private String gm(int index,String qt){
        String s = "";
        switch (index){
            case 1:
                s = "正常";
                break;
            case 2:
                s = "潮红";
                break;
            case 3:
                s = "苍白";
                break;
            case 4:
                s = qt;
                break;


        }
        return s;
    }


    //皮肤
    private String pf(int index,String qt){
        String s = "";
        switch (index){
            case 1:
                s = "正常";
                break;
            case 2:
                s = "潮红";
                break;
            case 3:
                s = "苍白";
                break;
            case 4:
                s = "发绀";
                break;
            case 5:
                s = "黄染";
                break;
            case 6:
                s = "色素沉重";
                break;
            case 7:
                s = qt;
                break;

        }
        return s;
    }

    //眼底
    private String yd(int index,String qt){
        String s = "";
        switch (index){
            case 1:
                s = "正常";
                break;
            case 2:
                s = qt;
                break;

        }
        return s;
    }

    //运动功能
    private String ydgn(int index){
        String s = "";
        switch (index){
            case 1:
                s = "可顺利完成";
                break;
            case 2:
                s = "无法独立完成任何一个动作";
                break;

        }
        return s;
    }

    //听力
    private String tl(int index){
        String s = "";
        switch (index){
            case 1:
                s = "听见";
                break;
            case 2:
                s = "听不清或无法听见";
                break;

        }
        return s;
    }

    //咽部
    private String yb(int index){
        String s = "";
        switch (index){
            case 1:
                s = "无充血";
                break;
            case 2:
                s = "充血";
                break;
            case 3:
                s = "淋巴滤泡增生";
                break;

        }
        return s;
    }

    //齿列
    private String cl(List<String> list){
        String s ="";
        for (int i =0; i<list.size() ;i++) {
            switch (list.get(i)) {
                case "1":
                    s += "正常  ";
                    break;
                case "2":
                    s += "缺齿  ";
                    break;
                case "3":
                    s += "龋齿  ";
                    break;
                case "4":
                    s += "义齿(假牙)  ";
                    break;

            }
        }
        return s;
    }

    //口唇
    private String kc(int index){
        String s = "";
        switch (index){
            case 1:
                s = "红润";
                break;
            case 2:
                s = "苍白";
                break;
            case 3:
                s = "发绀";
                break;
            case 4:
                s = "皲裂";
                break;
            case 5:
                s = "疱疹";
                break;

        }
        return s;

    }


    //无有
    private String wy(int index){
        String s = "";
        switch (index){
            case 1:
                s = "无";
                break;
            case 2:
                s = "有";
                break;

        }
        return s;

    }

    //是否
    private String sf(int index){
        String s = "";
        switch (index){
            case 1:
                s = "是";
                break;
            case 2:
                s = "否";
                break;

        }
        return s;

    }

    //饮酒类型
    private String yjzl(List<String> list,String qt){
        String s ="";
        for (int i =0; i<list.size() ;i++) {
            switch (list.get(i)) {
                case "1":
                    s += "白酒  ";
                    break;
                case "2":
                    s += "啤酒  ";
                    break;
                case "3":
                    s += "红酒  ";
                    break;
                case "4":
                    s += "黄酒  ";
                    break;
                case "5":
                    s +=qt;
                    break;


            }
        }
        return s;
    }

    //否是
    private String fs(int index){
        String s = "";
        switch (index){
            case 1:
                s = "否";
                break;
            case 2:
                s = "是";
                break;

        }
        return s;

    }


    //饮酒频率
    private String yjpl(int index){
        String s = "";
        switch (index){
            case 1:
                s = "从不";
                break;
            case 2:
                s = "偶尔";
                break;
            case 3:
                s = "经常";
                break;
            case 4:
                s = "每天";
                break;
        }
        return s;
    }

    //吸烟状况
    private String xyqk(int index){
        String s = "";
        switch (index){
            case 1:
                s = "从不吸烟";
                break;
            case 2:
                s = "已戒烟";
                break;
            case 3:
                s = "吸烟";
                break;
        }
        return s;

    }

    //饮食习惯
    private String ysxg(int index){
        String s= "";
        switch (index){
            case 1:
                s = "荤素均衡";
                break;
            case 2:
                s = "荤食为主";
                break;
            case 3:
                s = "素食为主";
                break;
            case 4:
                s = "嗜盐";
                break;
            case 5:
                s = "嗜油";
                break;
            case 6:
                s = "嗜糖";
                break;

        }
        return s;

    }

    //锻炼频率
    private String dlpl(int index){
        String s = "";
        switch (index){
            case 1:
                s = "每天";
                break;
            case 2:
                s = "每周一次以上";
                break;
            case 3:
                s = "偶尔";
                break;
            case 4:
                s = "不锻炼";
                break;
        }
        return s;
    }

    //老年人认知功能
    private String lnrrzgn(int index){
        String s = "";
        switch (index){
            case 1:
                s = "粗筛阴性";
                break;
            case 2:
                s = "粗筛阳性";
                break;

        }
        return s;

    }

    //老年人生活自理能力
    private String lnrzhzl(int index){
        String s = "";
        switch (index){
            case 1:
                s = "可自理(0~3)分";
                break;
            case 2:
                s = "轻度依赖(4~8)分";
                break;
            case 3:
                s = "中度依赖(9~18)分";
                break;
            case 4:
                s = "不能自理(>=19)分";
                break;
        }
        return s;
    }


    //老年人健康状态自我评估
    private String lnrjkzt(int index){
        String s = "";
        switch (index){
            case 1:
                s = "满意";
                break;
            case 2:
                s = "基本满意";
                break;
            case 3:
                s = "说不清楚";
                break;
            case 4:
                s = "不太满意";
                break;
            case 5:
                s = "不满意";
                break;
        }
        return s;
    }

    //症状
    private String zz(List<String> list ,String qt){
        String s ="";
        for (int i =0; i<list.size() ;i++) {
            switch (list.get(i)) {
                case "1":
                    s += "无症状  ";
                    break;
                case "2":
                    s += "头痛  ";
                    break;
                case "3":
                    s += "头晕  ";
                    break;
                case "4":
                    s += "心悸  ";
                    break;
                case "5":
                    s += "胸闷   ";
                    break;
                case "6":
                    s += "胸疼  ";
                    break;
                case "7":
                    s += "慢性咳嗽  ";
                    break;
                case "8":
                    s += "咳痰  ";
                    break;
                case "9":
                    s += "呼吸困难  ";
                    break;
                case "10":
                    s += "多饮   ";
                    break;
                case "11":
                    s += "多尿  ";
                    break;
                case "12":
                    s += "体重下降  ";
                    break;
                case "13":
                    s += "乏力  ";
                    break;
                case "14":
                    s += "关节疼痛  ";
                    break;
                case "15":
                    s += "视力模糊   ";
                    break;
                case "16":
                    s += "手脚麻木  ";
                    break;
                case "17":
                    s += "尿急  ";
                    break;
                case "18":
                    s += "尿痛  ";
                    break;
                case "19":
                    s += "便秘  ";
                    break;
                case "20":
                    s += "腹泻   ";
                    break;
                case "21":
                    s += "恶心呕吐  ";
                    break;
                case "22":
                    s += "眼花  ";
                    break;
                case "23":
                    s += "耳鸣  ";
                    break;
                case "24":
                    s += "乳房胀痛  ";
                    break;
                case "25":
                    s +=qt;
                    break;


            }
        }
        return s;

    }
}
